<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
  <!-- Sidebar user panel -->
  <!--<div class="user-panel">
    <div class="pull-left image">
      <img id="head" src="/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
    </div>
    <div class="pull-left info">
      <p id="nickname">admin</p>
      <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
    </div>
  </div>-->
  <!-- 侧边菜单-->
  <ul id="siderDiv" class="sidebar-menu" data-widget="tree">
    <!--<li class="treeview">
      <a href="#">
        <i class="fa fa-user-secret"></i> <span>管理员设置</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="1" onclick="saveStatus(1)"><a href="/pages/admin/AdminList.html"><i class="fa fa-circle-o"></i>管理员列表</a></li>
      </ul>
    </li>
    <li><a href="/pages/setting.html"><i class="fa fa-cog"></i> <span>基本设置</span></a></li>

    <li class="treeview">
      <a href="#">
        <i class="fa fa-group"></i> <span>渠道管理</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="2" onclick="saveStatus(2)"><a href="/pages/webmaster/list.html"><i class="fa fa-circle-o"></i>渠道列表</a></li>
      </ul>
    </li>

    <li class="treeview">
      <a href="#">
        <i class="fa fa-gamepad"></i> <span>游戏管理</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="3" onclick="saveStatus(3)"><a href="/pages/game/gameList.html"><i class="fa fa-circle-o"></i> 游戏列表</a></li>
      </ul>
    </li>
    <li class="treeview">
      <a href="#">
        <i class="fa fa-money"></i> <span>预算管理</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="4" onclick="saveStatus(4)"><a href="/pages/budget/list.html"><i class="fa fa-circle-o"></i>预算列表</a></li>
        <li id="5" onclick="saveStatus(5)"><a href="/pages/budget/recordlist.html"><i class="fa fa-circle-o"></i>明细列表</a></li>
      </ul>
    </li>
    <li class="treeview">
      <a href="#">
        <i class="fa fa-buysellads"></i> <span>广告管理</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="6" onclick="saveStatus(6)"><a href="/pages/ads/adsList.html"><i class="fa fa-circle-o"></i>广告列表</a></li>
      </ul>
    </li>

    <li class="treeview">
      <a href="#">
        <i class="fa fa-tasks"></i> <span>网站与广告位</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="7" onclick="saveStatus(7)"><a href="/pages/site/siteList.html"><i class="fa fa-circle-o"></i> 网站管理</a></li>
        <li id="8" onclick="saveStatus(8)"><a href="/pages/adsZone/adsZoneList.html"><i class="fa fa-circle-o"></i> 广告位管理</a></li>
      </ul>
    </li>

    <li class="treeview">
      <a href="#">
        <i class="fa fa-paste"></i> <span>广告模板管理</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="10" onclick="saveStatus(10)"><a href="/pages/adstemp/typeList.html"><i class="fa fa-circle-o"></i>广告类型</a></li>
        <li id="11" onclick="saveStatus(11)"><a href="/pages/adstemp/sizeList.html"><i class="fa fa-circle-o"></i>广告尺寸</a></li>
        <li id="12" onclick="saveStatus(12)"><a href="/pages/adstemp/styleList.html"><i class="fa fa-circle-o"></i>广告样式</a></li>
      </ul>
    </li>
    <li><a href="/pages/payLogList.html"><i class="fa fa-cc-visa"></i> <span>支付管理</span></a></li>


    <li class="treeview">
      <a href="#">
        <i class="fa fa-file-text"></i> <span>数据报表</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="13" onclick="saveStatus(13)"><a href="/pages/dataCount/webMaster.html"><i class="fa fa-circle-o"></i>渠道报表</a></li>
        <li id="14" onclick="saveStatus(14)"><a href="/pages/dataCount/adsList.html"><i class="fa fa-circle-o"></i>广告报表</a></li>
        <li id="15" onclick="saveStatus(15)"><a href="/pages/dataCount/adsZoneList.html"><i class="fa fa-circle-o"></i>广告位报表</a></li>
        <li id="16" onclick="saveStatus(16)"><a href="/pages/dataCount/ipList.html"><i class="fa fa-circle-o"></i>IP报表</a></li>
        <li id="17" onclick="saveStatus(17)"><a href="/pages/dataCount/webMasterSum.html"><i class="fa fa-circle-o"></i>渠道汇总</a></li>
      </ul>
    </li>

    <li class="treeview">
      <a href="#">
        <i class="fa fa-line-chart"></i> <span>流量分析</span>
        <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
      </a>
      <ul class="treeview-menu">
        <li id="20" onclick="saveStatus(20)"><a href="/pages/dataCount/trendChart.html"><i class="fa fa-circle-o"></i>趋势分析</a></li>
        <li id="18" onclick="saveStatus(18)"><a href="/pages/dataCount/clientChart.html"><i class="fa fa-circle-o"></i>客户端属性</a></li>
        <li id="19" onclick="saveStatus(19)"><a href="/pages/dataCount/areaChart.html"><i class="fa fa-circle-o"></i>地域分布</a></li>

      </ul>
    </li>-->


  </ul>
</section>
<script src="/dist/js/store.min.js"></script>
<script>
    $(function () {
        var id = store.get("status");
        var user_info = store.get("user_info");
        if(user_info == null){
            window.location.href = "/pages/admin/login.html";
        } else {
            $("#nickname").html(user_info.aname);
            // $("#head").attr("src", user_info.head);
            //动态加载菜单
            initSider();

        }
        if(id != null){
            $("#"+id).addClass("active").parent().parent().addClass("active treeview");
            //store.remove("status");
        }
    });
    function saveStatus(id) {
        store.set("status",id);
    }


    function initSider() {
        var user_info = store.get("user_info");

        let str='';
        str+='<li id="100" onclick="saveStatus(100)"><a href="/pages/setting.html"><i class="fa fa-cog"></i> <span>基本设置</span></a></li>';
        if(user_info.role=='0' || user_info.role=='2'){//admin 财务
            str+='<li class="treeview">';
            str+='<a href="#"><i class="fa fa-user-secret"></i> <span>管理员设置</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
            str+='<ul class="treeview-menu"><li id="1" onclick="saveStatus(1)"><a href="/pages/admin/AdminList.html"><i class="fa fa-circle-o"></i>管理员列表</a></li></ul>';
            str+='</li>';

            str+='<li id="101" onclick="saveStatus(101)"><a href="/pages/payLogList.html"><i class="fa fa-cc-visa"></i> <span>支付管理</span></a></li>';
        }

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-money"></i> <span>预算管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu">';
        str+='<li id="4" onclick="saveStatus(4)"><a href="/pages/budget/list.html"><i class="fa fa-circle-o"></i>预算列表</a></li>';
        str+='<li id="5" onclick="saveStatus(5)"><a href="/pages/budget/recordlist.html"><i class="fa fa-circle-o"></i>明细列表</a></li>';
        str+='</ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-group"></i> <span>渠道管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu"><li id="2" onclick="saveStatus(2)"><a href="/pages/webmaster/list.html"><i class="fa fa-circle-o"></i>渠道列表</a></li></ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-gamepad"></i> <span>游戏管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu"><li id="3" onclick="saveStatus(3)"><a href="/pages/game/gameList.html"><i class="fa fa-circle-o"></i> 游戏列表</a></li><li id="21" onclick="saveStatus(21)"><a href="/pages/webmaster/lygameList.html"><i class="fa fa-circle-o"></i>游戏下载地址管理</a></li></ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-buysellads"></i> <span>广告管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu"><li id="6" onclick="saveStatus(6)"><a href="/pages/ads/adsList.html"><i class="fa fa-circle-o"></i>广告列表</a></li></ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-tasks"></i> <span>网站与广告位</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu"><li id="7" onclick="saveStatus(7)"><a href="/pages/site/siteList.html"><i class="fa fa-circle-o"></i> 网站管理</a></li><li id="8" onclick="saveStatus(8)"><a href="/pages/adsZone/adsZoneList.html"><i class="fa fa-circle-o"></i> 广告位管理</a></li></ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-paste"></i> <span>广告模板管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu">';
        str+='<li id="10" onclick="saveStatus(10)"><a href="/pages/adstemp/typeList.html"><i class="fa fa-circle-o"></i>广告类型</a></li>';
        str+='<li id="11" onclick="saveStatus(11)"><a href="/pages/adstemp/sizeList.html"><i class="fa fa-circle-o"></i>广告尺寸</a></li>';
        str+='<li id="12" onclick="saveStatus(12)"><a href="/pages/adstemp/styleList.html"><i class="fa fa-circle-o"></i>广告样式</a></li>';
        str+='</ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-file-text"></i> <span>数据报表</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu">';
        str+='<li id="13" onclick="saveStatus(13)"><a href="/pages/dataCount/webMaster.html"><i class="fa fa-circle-o"></i>渠道报表</a></li>';
        str+='<li id="14" onclick="saveStatus(14)"><a href="/pages/dataCount/adsList.html"><i class="fa fa-circle-o"></i>广告报表</a></li>';
        str+='<li id="15" onclick="saveStatus(15)"><a href="/pages/dataCount/adsZoneList.html"><i class="fa fa-circle-o"></i>广告位报表</a></li>';
        str+='<li id="16" onclick="saveStatus(16)"><a href="/pages/dataCount/ipList.html"><i class="fa fa-circle-o"></i>IP报表</a></li>';
        str+='<li id="17" onclick="saveStatus(17)"><a href="/pages/dataCount/webMasterSum.html"><i class="fa fa-circle-o"></i>渠道汇总</a></li>';
        str+='</ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-line-chart"></i> <span>流量分析</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu">';
        str+='<li id="20" onclick="saveStatus(20)"><a href="/pages/dataCount/trendChart.html"><i class="fa fa-circle-o"></i>趋势分析</a></li>';
        str+='<li id="18" onclick="saveStatus(18)"><a href="/pages/dataCount/clientChart.html"><i class="fa fa-circle-o"></i>客户端属性</a></li>';
        str+='<li id="19" onclick="saveStatus(19)"><a href="/pages/dataCount/areaChart.html"><i class="fa fa-circle-o"></i>地域分布</a></li>';
        str+='</ul>';
        str+='</li>';

        str+='<li class="treeview">';
        str+='<a href="#"><i class="fa fa-file-text"></i> <span>游戏指标分析</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
        str+='<ul class="treeview-menu">';
       /* str+='<li id="22" onclick="saveStatus(22)"><a href="/pages/dataCount/gameCount.html"><i class="fa fa-circle-o"></i>游戏报表</a></li>';
        str+='<li id="24" onclick="saveStatus(24)"><a href="/pages/dataCount/nowGameCount.html"><i class="fa fa-circle-o"></i>当日游戏数据</a></li>';*/

        if(user_info.role=='0') {//admin
            str += '<li id="22" onclick="saveStatus(22)"><a href="/pages/dataCount/ele_gameCount_game.html"><i class="fa fa-circle-o"></i>游戏报表-游戏</a></li>';
        }
        str+='<li id="23" onclick="saveStatus(23)"><a href="/pages/dataCount/ele_gameCountSucai.html"><i class="fa fa-circle-o"></i>游戏报表-素材</a></li>';
        str+='<li id="25" onclick="saveStatus(25)"><a href="/pages/dataCount/ele_now_gameCountSucai.html"><i class="fa fa-circle-o"></i>当日游戏数据-素材</a></li>';
        str+='<li id="26" onclick="saveStatus(26)"><a href="/pages/dataCount/arpuChart.html"><i class="fa fa-circle-o"></i>ARPU走势</a></li>';

        str+='<li id="27" onclick="saveStatus(27)"><a href="/pages/dataCount/drList.html"><i class="fa fa-circle-o"></i>用户留存</a></li>';

        str+='<li id="28" onclick="saveStatus(28)"><a href="/pages/dataCount/gameRecord.html"><i class="fa fa-circle-o"></i>游戏日志记录</a></li>';
        str+='<li id="29" onclick="saveStatus(29)"><a href="/pages/dataCount/gameModelChart.html"><i class="fa fa-circle-o"></i>游戏机型分布</a></li>';
        str+='<li id="30" onclick="saveStatus(30)"><a href="/pages/dataCount/gameRegionChart.html"><i class="fa fa-circle-o"></i>游戏区域分布</a></li>';
        str+='</ul>';
        str+='</li>';


        $("#siderDiv").html(str);

    }
</script>




